<{Tinclude "commom/admin_header"}>
  <section id="container" >
      
      <!--顶部-->
      <{Tinclude"commom/admin_inner_header"}>
      <!--顶部-->
      
       <{Tinclude"commom/admin_left_menu"}>
       
       
       
       <section id="main-content">
          <section class="wrapper">
          	<h3><i class="fa fa-list-ul"></i>后台菜单列表</h3>
                <div class="row mt">
                  <div class="col-md-12">
                      <div class="content-panel">
                           <h4><i class="fa fa-angle-right"></i> 菜单列表</h4>

                           <h4>
                       <a href="<{echo Common::RewriteUrl("Menu","index");}>" class="btn btn-theme02"><span class="fa fa-plus-circle"></span>添加菜单</a>
                           </h4>
                           <section id="no-more-tables">
                          <table class="table table-striped table-condensed table-hover cf"> 	 
                              <thead class="cf">
                              <tr>
                                  <th><i class="fa fa-heart"></i> 菜单名称</th>
                                  <th><i class="fa fa-location-arrow"></i> 父级菜单</th>
                                  <th><i class="fa fa-crosshairs"></i> 控制器</th>
                                  <th><i class="fa fa-font"></i> 方法</th>
                                  <th>操作</th>
                              </tr>
                              </thead>
                              <tbody>
                                  <{foreach $_menulist as $v}>
                              <tr>
                                  <td data-title="菜单名称"><a href="<{echo Common::RewriteUrl("Menu","edit","&id=".$v["id"]);}>"><{$v["base_name"]}></a></td>
                                  <td data-title="父类名称"><{$v["parent"]}></td>
                                  <td data-title="控制器"><{$v["c"]}></td>
                                  <td data-title="方法"><span class="label label-info label-mini"><{$v["a"]}></span></td>
                                  <td data-title="操作">
                                      <{if $v["is_display"]==0}>
                                      <button data-toggle="tooltip"  title="显示" data-id="<{$v["id"]}>" data-placement="top" class="btn btn-success btn-xs xs"><i class="fa fa-check"></i></button>
                                      <{else}>
                                      <button data-toggle="tooltip" title="不显示" data-id="<{$v["id"]}>" data-placement="top" class="btn btn-success btn-xs bxs"><i class="fa fa-minus"></i></button>
                                      <{/if}>
                                      <button data-toggle="tooltip" title="添加子菜单" data-id="<{$v["id"]}>"  data-placement="top" class="btn btn-primary btn-xs tjzcd"><i class="fa fa-folder-open"></i></button>
                                      <button data-toggle="tooltip" title="编辑" data-id="<{$v["id"]}>"  data-placement="top" class="btn btn-primary btn-xs edit"><i class="fa fa-pencil"></i></button>
                                      <button data-toggle="tooltip" title="删除" data-id="<{$v["id"]}>"  data-placement="top" class="btn btn-danger btn-xs del"><i class="fa fa-trash-o "></i></button>
                                  </td>
                              </tr>
                              <{/foreach}>
                              </tbody>
                       
                          </table>
                               <div class="text-center">  <{Tinclude"commom/pager"}></div>
                           </section>
                      </div>
                  </div>
              </div>
          </section>
       </section>
   </section>
<script>
$(function () {
  $('[data-toggle="tooltip"]').tooltip();
  $(".xs").click(function(){
      var id=$(this).data("id");
      $.post("<{echo Common::RewriteUrl("Menu","public_ajax_isdisplay");}>",{"id":id,"display":1},function(data){
          if(data.status==1){
              window.location.reload();
          }
      },"json");
  });
   $(".del").click(function(){
       var id=$(this).data("id");
       window.location.href="<{echo Common::RewriteUrl("Menu","delete");}>&id="+id;
   });
    $(".edit").click(function(){
       var id=$(this).data("id");
       window.location.href="<{echo Common::RewriteUrl("Menu","edit");}>&id="+id;
   });
   
    $(".tjzcd").click(function(){
       var id=$(this).data("id");
       window.location.href="<{echo Common::RewriteUrl("Menu","addbypid");}>&pid="+id;
   });
   
  $(".bxs").click(function(){
      var id=$(this).data("id");
      $.post("<{echo Common::RewriteUrl("Menu","public_ajax_isdisplay");}>",{"id":id,"display":0},function(data){
          if(data.status==1){
              window.location.reload();
          }
      },"json");
  });
});
</script>
<{Tinclude"commom/admin_footer"}>